<template>
  <div class="container">
    <div class="head">
      <div class="box">
        <mx-link href="/m/ad/zh" to="/ad/zh" class="language-toggle" :with-locale="true">
          <i class="el-icon-refresh"></i>
          <span>简体中文</span>
        </mx-link>
        <p class="title">
          TNAOT Media Advertising Solutions
        </p>
        <p class="desc">
          Multi-channel precision targeting of local users for brand exposure and efficient conversion
        </p>
      </div>
    </div>
    <div class="img-container">
      <img v-for="img in enImages" :key="img" :src="img" />
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      enImages: []
    };
  },
  mounted() {
    // 英文图片
    const enImagesContext = require.context(
      '@/assets/images/ade',
      false,
      /\.(png|jpg)$/
    );
    enImagesContext
      .keys()
      .sort((a, b) => {
        const numA = parseInt(a.match(/\d+/)[0], 10);
        const numB = parseInt(b.match(/\d+/)[0], 10);
        return numA - numB;
      })
      .forEach(k => {
        this.enImages.push(enImagesContext(k));
      });
  }
};
</script>

<style scoped>
.head {
  display: flex;
  justify-content: center;
}

.box {
  background: linear-gradient(45deg, #e53e3e, #ff6b6b);
  width: 1200px;
  padding: 25px;
  color: #fff;
  text-align: center;
  position: relative;
}

.title {
  font-size: 40px;
  font-weight: 300;
  margin-bottom: 10px;
}

.desc {
  font-size: 19.2px;
}

.language-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: bold;
}

.language-toggle:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.img-container {
  padding: 20px;
  background-color: #fff;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}
img {
  width: 1200px;
}
</style>
